package com.example.lib_arouter

import android.os.Bundle
import android.util.Log
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter

@Route(path = "/test/TestSplashActivity")
class TestSplashActivity : AppCompatActivity() {
    val TAG = "TestARouter"
    val tvName:TextView by lazy { findViewById(R.id.tv_name) }
    val tvTextView:TextView by lazy { findViewById(R.id.tv_test) }
    @Autowired(name = "name")
    @JvmField
    var name: String = ""

    @Autowired(name = "userList")
    @JvmField
    var mList:ArrayList<String> ?= null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test_splash)
        ARouter.getInstance().inject(this)
        Log.d(TAG, "测试ARouter数据传递$name$mList")
        initView()
    }

    private fun initView() {
        tvName.text = "测试ARouter跳转$name"
        tvTextView.text = mList.toString()
    }
}